<template>
  <div>
    <home-header :sellers="sellers"></home-header>
    <home-tab></home-tab>
    <home-content :sellers="sellers"></home-content>
  </div>
</template>

<script>
import HomeHeader from './components/Header'
import HomeContent from './components/Content'
import HomeTab from './components/Tab'
import axios from 'axios'
export default {
  name: 'home',
  components: {
    HomeHeader,
    HomeContent,
    HomeTab
  },
  data () {
    return {
      sellers: {},
      goods: [],
      ratings: []
    }
  },
  methods: {
    getHomeInfo () {
      axios.get('/static/data.json')
        .then(this.getHomeInfoSucc)
    },
    getHomeInfoSucc (res) {
      if (res) {
        const data = res.data
        this.sellers = data.seller
        this.$store.dispatch('getinfo', data)
      }
    }
  },
  created () {
    this.getHomeInfo()
  }
}
</script>

<style>
</style>
